package cz.muni.fi.pa165.musiclibrary.api.service.dto;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.joda.time.Duration;

/**
*
* @author Martin Majlath
* 2012-10-28T19:36:18+0100
*/
public interface ISongDTO extends IDTOObject {
    
    /**
     * Returns identifier of this song.
     * @return Identifier of this song.
     */
    @Nonnull
    Long getIdSong();
    
    /**
     * Returns artist performing this song.
     * @return Artist performing this song.
     */
    @Nonnull
    IArtistDTO getArtist();
    
    /**
     * Returns genre of this song.
     * @return Genre of this song.
     */
    @Nonnull
    IGenreDTO getGenre();
    
    /**
     * Returns album that contains this song.
     * @return Album that contains this song.
     */
    @Nullable
    IAlbumDTO getAlbum();
    
    /**
     * Returns title of this song.
     * @return Title of this song.
     */
    @Nonnull
    String getTitle();
    
    /**
     * Returns bitrate of this song in kbps.
     * @return Bitrate of this song in kbps.
     */
    @Nonnull
    Integer getBitrate();
    
    /**
     * Returns length of this song.
     * @return Length of this song.
     */
    @Nullable
    Duration getLength();
    
    /**
     * Returns track number of this song on album.
     * @return Track number of this song.
     */
    @Nullable
    Integer getTrackNumber();
    
    /**
     * Returns comment for this song.
     * @return Comment for this song.
     */
    @Nullable
    String getComment();
    
    /**
     * Sets identifier of this song.
     * @param idSong Identifier of this song. Cannot be {@code null}.
     */
    void setIdSong(@Nonnull final Long idSong);
    
    /**
     * Sets artist performing this song.
     * @param artist Artist performing this song. Cannot be {@code null}.
     */
    void setArtist(@Nonnull final IArtistDTO artist);
    
    /**
     * Sets genre of this song.
     * @param genre Genre of this song. Cannot be {@code null}.
     */
    void setGenre(@Nonnull final IGenreDTO genre);
    
    /**
     * Sets album that contains this song.
     * @param album Album that contains this song.
     */
    void setAlbum(@Nullable final IAlbumDTO album);
    
    /**
     * Sets title of this song.
     * @param title Title of this song. Cannot be {@code null}.
     */
    void setTitle(@Nonnull final String title);
    
    /**
     * Sets bitrate (in kbps) of this song.
     * @param bitrate Bitrate (in kbps) of this song. Cannot be {@code null}.
     */
    void setBitrate(@Nonnull final Integer bitrate);
    
    /**
     * Sets length of this song.
     * @param length Length of this song.
     */
    void setLength(@Nullable final Duration length);
    
    /**
     * Sets track number of this song on album.
     * @param trackNumber Track number of this song on album.
     */
    void setTrackNumber(@Nullable final Integer trackNumber);
    
    /**
     * Sets comment for this song.
     * @param comment Comment for this song.
     */
    void setComment(@Nullable final String comment);
    
    /**
     * Two songs are equal, if and only if their identifiers 
     * ({@link #getIdSong()}) are equal.
     * 
     * @param obj The reference object with which to compare.
     * @return {@code true} if this object is the same as the obj
     *          argument; {@code false} otherwise.
     */
    @Override
    boolean equals(final Object obj);
    
    /**
     * Returns hash code value for this object based on {@link #getIdSong()} value. 
     * @return Hash code value for this object.
     */
    @Override
    int hashCode();

}
